package com.leyou.common.exceptions;

import com.leyou.common.enums.ExceptionEnum;
import lombok.Getter;

/**
 * @author syf
 * @version 1.0
 * @date 2019/07/29 15:07
 * @Description TODO:自定义异常
 */
@Getter
public class LyException extends RuntimeException {

    private int status;

    public LyException(int status ,String msg){
        super(msg);
        this.status=status;
    }

    public LyException(ExceptionEnum e) {
        super(e.getMessage());
        this.status = e.getStatus();
    }

    public LyException(ExceptionEnum e, Throwable cause) {
        super(e.getMessage(), cause);
        this.status = e.getStatus();
    }
}
